extends Node

export(PackedScene) var home_brick_tscn:PackedScene

export(PackedScene) var home_golden_tscn:PackedScene

var home_brick

var home_golden

func _ready():
	set_bricks()
	pass

func set_bricks():
	if home_golden!=null and is_instance_valid(home_golden):
		home_golden.queue_free()
	home_brick=home_brick_tscn.instance()
	self.call_deferred("add_child",home_brick)
	pass

func set_golden():
	if home_brick!=null and is_instance_valid(home_brick):
		home_brick.queue_free()
	home_golden=home_golden_tscn.instance()
	self.call_deferred("add_child",home_golden)
	$GoldenTimer.start()
	pass


func _on_GoldenTimer_timeout():
	set_bricks()
	pass # Replace with function body.
